<?php
namespace app\erp\validate;
use think\Validate;
class Outlinkrule extends Validate{
    protected $rule = [
        'outlink_name' => 'require|unique:outlink,outlink_name^partner_id',
        'sort'=> 'require|number'
    ];

    protected $message = [
        'outlink_name.require' => '外链名称必须填写',
        'outlink_name.unique' => '外链名称已存在',
        'sort.require' => '排序不能为空',
        'sort.number' => '排序只能是数字'
    ];
    protected $scene = [
        'edit' => [
            'outlink_name' => 'unique:outlink,outlink_name^partner_id',
            'sort' => 'number'
        ]
    ];
}